﻿using Loong.Admin.Security.Authentication.JwtBearer;
using Loong.Admin.Security.Cryptography;
using Loong.Admin.Text.Normalization;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.Modularity;

namespace Loong.Admin
{
    public class AdminCoreModule : AbpModule
    {
        public override void ConfigureServices(ServiceConfigurationContext context)
        {
            var configuration = context.Services.GetConfiguration();

            context.Services.TryAddScoped<IPasswordHasher, PasswordHasher>();
            context.Services.TryAddScoped<ILookupNormalizer, UpperInvariantLookupNormalizer>();
            context.Services.TryAddScoped<JwtHandler>();
            Configure<JwtOptions>(configuration.GetSection("Authentication:Jwt"));
        }
    }
}